package cn.power.service;

import cn.power.dao.UserMapper;
import cn.power.pojo.User;
import cn.power.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service

public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
    @Override
    public User findUser(String name, String pwd) {
        User user=userMapper.getUserByName(name);
        System.out.println(user);
        String s=MD5Util.stringToMD5(pwd);
        if(user.getUserPassword().equals(MD5Util.stringToMD5(pwd))){
            System.out.println("密码正确");
            return user;
        }
        return null;
    }
}
